/**
 * 
 */
package sv.gob.mh.dgii.model;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author melvin.henriquez
 * 
 */
@Entity
@Table(name = "DV_CRED_FIS_EXP_DET", schema = "DEVOLUCIONES")
public class DvCredFisExpDet implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6198035749762104654L;
	private DvCredFisExpDetId id;
	private RcRuc rcRuc;
	private String snombreProveedor;
	private String ntelefono;
	private Double vtotalCred;
	private DvCredFisExp dvCredFisExp;

	public DvCredFisExpDet() {
		// TODO Auto-generated constructor stub
	}

	public DvCredFisExpDet(DvCredFisExpDetId id, RcRuc rcRuc, String ntelefono, Double vtotalCred) {
		this.id = id;
		this.rcRuc = rcRuc;
		this.ntelefono = ntelefono;
		this.vtotalCred = vtotalCred;
	}

	/**
	 * @return the id
	 */
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "iindice", column = @Column(name = "I_INDICE", nullable = false, precision = 18, scale = 0)),
			@AttributeOverride(name = "ncorrelativo", column = @Column(name = "N_CORRELATIVO", nullable = false, precision = 18, scale = 0)) })
	public DvCredFisExpDetId getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(DvCredFisExpDetId id) {
		this.id = id;
	}

	/**
	 * @return the rcRuc
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "NIT", unique = false, nullable = true, insertable = true, updatable = true)
	public RcRuc getRcRuc() {
		return rcRuc;
	}

	/**
	 * @param rcRuc
	 *            the rcRuc to set
	 */
	public void setRcRuc(RcRuc rcRuc) {
		this.rcRuc = rcRuc;
	}

	/**
	 * @return the snombreProveedor
	 */
	@Column(insertable = true, name = "S_NOMBRE_PROVEEDOR", nullable = true, length = 100)
	public String getSnombreProveedor() {
		return snombreProveedor;
	}

	/**
	 * @param snombreProveedor
	 *            the snombreProveedor to set
	 */
	public void setSnombreProveedor(String snombreProveedor) {
		this.snombreProveedor = snombreProveedor;
	}

	/**
	 * @return the ntelefono
	 */
	@Column(insertable = true, name = "N_TELEFONO", nullable = true, length = 8, updatable = true)
	public String getNtelefono() {
		return ntelefono;
	}

	/**
	 * @param ntelefono
	 *            the ntelefono to set
	 */
	public void setNtelefono(String ntelefono) {
		this.ntelefono = ntelefono;
	}

	/**
	 * @return the vtotalCred
	 */
	@Column(name = "V_TOTAL_CRED", nullable = true, precision = 11, scale = 2)
	public Double getVtotalCred() {
		return vtotalCred;
	}

	/**
	 * @param vtotalCred
	 *            the vtotalCred to set
	 */

	public void setVtotalCred(Double vtotalCred) {
		this.vtotalCred = vtotalCred;
	}

	/**
	 * @return the dvCredFisExp
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "I_INDICE", nullable = false, insertable = false, updatable = false)
	public DvCredFisExp getDvCredFisExp() {
		return dvCredFisExp;
	}

	/**
	 * @param dvCredFisExp
	 *            the dvCredFisExp to set
	 */
	public void setDvCredFisExp(DvCredFisExp dvCredFisExp) {
		this.dvCredFisExp = dvCredFisExp;
	}

}
